﻿@model MvcApplication4.Models.Post
@{
    Layout = null;
    ViewBag.Title = "Create";
    Session.Add(MvcApplication4.Controllers.SaveVarsController.SessionThreadIdName, (long)ViewBag.ThreadId);
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")"></script>

@if (!User.Identity.IsAuthenticated)
{
    <div id="UnauthorizedText">Please @Html.ActionLink("Sign In","Login", "Account") to Post a message.</div>
    
}
else
{
    using (Html.BeginForm())
    {
        @Html.ValidationSummary(true)

        <fieldset>
            <legend>Post in @ViewBag.ThreadName</legend>
            <div style="margin-top: 25px;">
                @Html.TextAreaFor(model => model.Text, new { Class = "editor-field_large" })
                @Html.ValidationMessageFor(model => model.Text)
            </div>
            <p>
                <input type="submit" value="Post" />
            </p>
        </fieldset>
    }
}


